#REM

<div class="BasketAddressForm">
#IF(#Shop.BillingAddressSetVisibleFields EQ "" AND #Shop.ShippingAddressSetVisibleFields EQ "")
<div class="DialogMessage MessageError">
  <h3>{ConfigurationError}</h3>
  <p>{NoAddressFieldsVisible}</p>
</div>
#ELSE
 #IF(#FormErrors.Reason.IsShippingAddressMandatory OR #FormErrors.Reason.IsBillingAddressMandatory)
  <div class="DialogMessage MessageWarning">
    <h3>{InputError}</h3>
    #IF(#FormErrors.Reason.FORMAT_NOT_INTEGER OR #FormErrors.Reason.FORMAT_NOT_FLOAT){WRONG_NUMBER_FORMAT}<br />#ENDIF
    {PleaseCorrectErrors}
  </div>
  <div class="Separator"></div>
 #ENDIF
 #IF(#FormError AND NOT(#FormErrors.Form.Login.ErrorCount))
  #IF(#FormErrors.Reason.NO_USER_NAME OR #FormErrors.Reason.LOGIN_EXISTS OR #FormErrors.Reason.NO_USER_PWD
  OR #FormErrors.Reason.PWD_NOT_SAME OR #FormErrors.Reason.PASSWORD_WRONG OR #FormErrors.Reason.FORMAT_NOT_INTEGER
  OR #FormErrors.Reason.FORMAT_NOT_FLOAT OR #FormError_AcceptPrivacyPolicy
  OR #FormErrors.Reason.FORMAT_NOT_EMAILADDRESS OR #FormErrors.Reason.VATIDIsNotFromSameCountry OR #FormErrors.Reason.VATIDIsNotValid
   OR #FormErrors.Reason.ZIPCODE_NOT_VALID)
  <div class="DialogMessage MessageWarning">
    <h3>{InputError}</h3>
    #IF(#FormErrors.Reason.NO_USER_NAME)<p>{NO_USER_NAME}</p>#ENDIF
    #IF(#FormErrors.Reason.LOGIN_EXISTS)<p>{LOGIN_EXISTS}</p>#ENDIF
    #IF(#FormErrors.Reason.NO_USER_PWD)<p>{NoPassword}</p>#ENDIF
    #IF(#FormErrors.Reason.PWD_NOT_SAME)<p>{PWD_NOT_SAME}</p>#ENDIF
    #IF(#FormErrors.Reason.PASSWORD_WRONG)<p>{WrongPassword}</p>#ENDIF
    #IF(#FormErrors.Reason.VATIDIsNotFromSameCountry)<p>{VATIDIsNotFromSameCountry}</p>#ENDIF
    #IF(#FormErrors.Reason.VATIDIsNotValid)<p>{VATIDIsNotValid}</p>#ENDIF
    #IF(#FormErrors.Reason.FORMAT_NOT_INTEGER OR #FormErrors.Reason.FORMAT_NOT_FLOAT)<p>{WRONG_NUMBER_FORMAT}</p>#ENDIF
    #IF(#FormError_AcceptPrivacyPolicy)<p>{ErrorAcceptPrivacyPolicy}</p>#ENDIF
    #IF(#FormErrors.Reason.FORMAT_NOT_EMAILADDRESS)<p>{FormatNotEMail}</p>#ENDIF
    #IF(#FormErrors.Reason.ZIPCODE_NOT_VALID)<p>{ZipcodeNotValid}</p>#ENDIF
    <p>{PleaseCorrectErrors}</p>
  </div>
  #ELSE
  #IF(#FormErrors.Reason.STRING_EMPTY)
  <div class="DialogMessage MessageInfo">
    <h3>{FillOutForm}</h3>
    {MandatoryFields}
  </div>
  #ENDIF
  #ENDIF
 #ENDIF
#ENDIF
  <form id="BasketAddressForm" class="ep-metaparse ep.uiForm()" action="?ObjectID=#ID" method="post">
<div class="TableHead"><div>
  {NonMemberQuestion}
</div></div>
<div class="DialogSnippet">
  {NonMemberInfo}
  <div class="TopSmallMargin">{MandatoryFields}</div>
</div>

#LOCAL("AddressType", "ShippingAndBillingAddress")
#LocaleInclude("INC-AddressForm", #INPUT.Language[UC])
#ENDLOCAL
#LOCAL("ShopRegistrationField", #Shop.RegistrationField)
 #WITH_ERROR(#FormError)

 #IF(#Shop.ShippingAddressSetVisibleFields)

 #IF(NOT #ShippingAddress.ID)
  <div id="EnableShippingAddressBlock"><input class="AlignMiddle ep-metaparse ep.uiInput()" type="checkbox" id="EnableShippingAddress" name="EnableShippingAddress" />
  <label for="EnableShippingAddress">{SeparateShippingAddress}</label></div>
  #ENDIF
  <div id="ShippingAddressBlock">
    <div class="TableHead"><div>{ShippingAddress}</div></div>
    <div class="Dialog AddressDialog">
      <div class="SizeContainer">
        <div class="TextBlock">
          {DifferentFromBillingAddress}<br /><br />
        </div>
      #IF(#ShopRegistrationField.Company.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Company} #IF(#ShopRegistrationField.Company.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Company.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingCompany) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingCompany" value="#IF(#ShippingCompany)#ShippingCompany#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.VATID.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{VATID} #IF(#ShopRegistrationField.VATID.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.VATID.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_VATID) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingVATID" value="#IF(#INPUT.ShippingVATID)#INPUT.ShippingVATID#ELSIF(#ShippingVATID)#ShippingVATID#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.Department.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Department} #IF(#ShopRegistrationField.Department.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Department.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingDepartment) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingDepartment" value="#IF(#ShippingDepartment)#ShippingDepartment#ENDIF" /></div>
          </div>
      #ENDIF
          <div class="InputBlock">
            <br />
          </div>
      #IF(#ShopRegistrationField.Gender.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Gender} #IF(#ShopRegistrationField.Gender.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField">
              <input type="radio" name="ShippingGender" value="1" id="ShippingGender1" #IF(#ShippingGender == "1")checked="checked" #ENDIF class="ep-metaparse #IF(#ShopRegistrationField.Gender.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingGender) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" />
              <label for="ShippingGender1">{Male}</label>
              <input type="radio" name="ShippingGender" value="2" id="ShippingGender2" #IF(#ShippingGender == "2")checked="checked" #ENDIF class="ep-metaparse #IF(#ShopRegistrationField.Gender.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingGender) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" />
              <label for="ShippingGender2">{Female}</label>
            </div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.Salutation.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Salutation} #IF(#ShopRegistrationField.Salutation.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField">
              <input class="Text ep-metaparse #IF(#ShopRegistrationField.Salutation.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingSalutation) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingSalutation" value="#IF(#ShippingSalutation)#ShippingSalutation#ENDIF" />
            </div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.Title.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Title} #IF(#ShopRegistrationField.Title.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField">
              <input class="Text ep-metaparse #IF(#ShopRegistrationField.Title.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingTitle) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingTitle" value="#IF(#ShippingTitle)#ShippingTitle#ENDIF" />
            </div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.FirstName.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{FirstName} #IF(#ShopRegistrationField.FirstName.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.FirstName.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingFirstName) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingFirstName" id="ShippingFirstName" value="#IF(#ShippingFirstName)#ShippingFirstName#ENDIF" #IF(#ShopRegistrationField.DisplayName.IsShippingAddressVisible AND #ShopRegistrationField.LastName.IsShippingAddressVisible)onchange="SFautofillAddress('ShippingFirstName','ShippingLastName','ShippingDisplayName')"#ENDIF /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.MiddleName.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{MiddleName} #IF(#ShopRegistrationField.MiddleName.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.MiddleName.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingMiddleName) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingMiddleName" value="#IF(#ShippingMiddleName)#ShippingMiddleName#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.LastName.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{LastName} #IF(#ShopRegistrationField.LastName.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.LastName.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingLastName) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingLastName" id="ShippingLastName" value="#IF(#ShippingLastName)#ShippingLastName#ENDIF"  #IF(#ShopRegistrationField.DisplayName.IsShippingAddressVisible AND #ShopRegistrationField.FirstName.IsShippingAddressVisible)onchange="SFautofillAddress('ShippingFirstName','ShippingLastName','ShippingDisplayName')"#ENDIF /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.DisplayName.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{DisplayName} #IF(#ShopRegistrationField.DisplayName.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.DisplayName.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingDisplayName) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingDisplayName" id="ShippingDisplayName" value="#IF(#ShippingDisplayName)#ShippingDisplayName#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.AddressExtension.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{AddressExtension} #IF(#ShopRegistrationField.AddressExtension.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.AddressExtension.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingAddressExtension) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingAddressExtension" value="#IF(#ShippingAddressExtension)#ShippingAddressExtension#ENDIF" /></div>
          </div>
      #ENDIF
          <div class="InputBlock">
            <br />
          </div>
      #IF(#ShopRegistrationField.Street.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Street} #IF(#ShopRegistrationField.Street.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Street.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingStreet) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingStreet" value="#IF(#ShippingStreet)#ShippingStreet#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.Street2.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Street} #IF(#ShopRegistrationField.Street2.IsShippingAddressMandatory){MandatoryStar}#ENDIF<br />({Street2})</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Street2.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingStreet2) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingStreet2" value="#IF(#ShippingStreet2)#ShippingStreet2#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.CodePorte.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{CodePorte} #IF(#ShopRegistrationField.CodePorte.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.CodePorte.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingCodePorte) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingCodePorte" value="#IF(#ShippingCodePorte)#ShippingCodePorte#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.Zipcode.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Zipcode} #IF(#ShopRegistrationField.Zipcode.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Zipcode.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingZipcode) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingZipcode" value="#IF(#ShippingZipcode)#ShippingZipcode#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.City.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{City} #IF(#ShopRegistrationField.City.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.City.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingCity) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingCity" value="#IF(#ShippingCity)#ShippingCity#ENDIF" /></div>
          </div>
      #ENDIF
    #LOCAL("HasUS", 0)
      #IF(#ShopRegistrationField.CountryID.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Country} #IF(#ShopRegistrationField.CountryID.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField">
              <select name="ShippingCountryID" class="LongText ep-metaparse #IF(#ShopRegistrationField.CountryID.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingCountryID) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" id="2ndAddress#ID#SPACE[0]_CountryID">
                <option value="">{EmptyEntry}</option>#LOOP(#Shop.ShopCountries)#IF(#Code2 EQ "US")#SET("HasUS", 1)#ENDIF
                <option abbr="#Code2" value="#CountryID" #IF((#DEFINED(#ShippingCountryID) AND #ShippingCountryID == #CountryID) OR (#DEFINED(#INPUT.ShippingCountryID) AND #INPUT.ShippingCountryID == #CountryID))selected="selected"#ENDIF>#IF(#Native)#Native #IF(#English NE #Native)(#English)#ENDIF #ELSE#English#ENDIF</option>#ENDLOOP
              </select>
            </div>
          </div>
      #ENDIF
      #IF(#HasUS)
	          <div class="InputBlock#IF(NOT #RegField.ShippingState.IsVisible) HideElement#ENDIF" id="2ndAddress#ID#SPACE[0]_State">
	            <div class="InputLabelling">{State} #IF(#ShopRegistrationField.State.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
	            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.State.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingState) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingState" value="#IF(#ShippingState)#ShippingState#ENDIF" id="2ndAddress#ID#SPACE[0]_Form" /><noscript><p style="width:201px;">{USStateNoScript}</p></noscript></div>
	          </div>
            #SNIPPET("INC-USStates", "Prefix,InputName", "2ndAddress", "ShippingState")
      #ELSE
            <div class="InputBlock">
              <div class="InputLabelling">{State} #IF(#ShopRegistrationField.State.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
              <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.State.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingState) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingState" value="#IF(#ShippingState)#ShippingState#ENDIF" /></div>
            </div>
    #ENDIF
  #ENDLOCAL
          <div class="InputBlock">
            <br />
          </div>
      #IF(#ShopRegistrationField.JobTitle.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{JobTitle} #IF(#ShopRegistrationField.JobTitle.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.JobTitle.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingJobTitle) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingJobTitle" value="#IF(#ShippingJobTitle)#ShippingJobTitle#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.Phone.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Phone} #IF(#ShopRegistrationField.Phone.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Phone.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingPhone) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingPhone" value="#IF(#ShippingPhone)#ShippingPhone#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.PhoneBusiness.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{PhoneBusiness} #IF(#ShopRegistrationField.PhoneBusiness.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.PhoneBusiness.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingPhoneBusiness) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingPhoneBusiness" value="#IF(#ShippingPhoneBusiness)#ShippingPhoneBusiness#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.PhonePrivate.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{PhonePrivate} #IF(#ShopRegistrationField.PhonePrivate.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.PhonePrivate.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingPhonePrivate) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingPhonePrivate" value="#IF(#ShippingPhonePrivate)#ShippingPhonePrivate#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.PhoneCell.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{PhoneCell} #IF(#ShopRegistrationField.PhoneCell.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.PhoneCell.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingPhoneCell) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingPhoneCell" value="#IF(#ShippingPhoneCell)#ShippingPhoneCell#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.Fax.IsShippingAddressVisible)
          <div class="InputBlock#IF(#FormError_ShippingFax) DialogError#ENDIF">
            <div class="InputLabelling">{Fax} #IF(#ShopRegistrationField.Fax.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Fax.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingFax) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingFax" value="#IF(#ShippingFax)#ShippingFax#ENDIF" /></div>
          </div>
      #ENDIF
          <div class="InputBlock">
            <br />
          </div>
      #IF(#ShopRegistrationField.EMail.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{EMail} #IF(#ShopRegistrationField.EMail.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.EMail.IsShippingAddressMandatory) ep.uiValidate({required:true,type:'email' #IF(#FormError_ShippingEMail) ,valid:false #ENDIF }) #ELSE ep.uiValidate({type:'email'}) #ENDIF" name="ShippingEMail" value="#IF(#ShippingEMail)#ShippingEMail#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.EMailBusiness.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{EMailBusiness} #IF(#ShopRegistrationField.EMailBusiness.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.EMailBusiness.IsShippingAddressMandatory) ep.uiValidate({required:true,type:'email' #IF(#FormError_ShippingEMailBusiness) ,valid:false #ENDIF }) #ELSE ep.uiValidate({type:'email'}) #ENDIF" name="ShippingEMailBusiness" value="#IF(#ShippingEMailBusiness)#ShippingEMailBusiness#ENDIF" /></div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.EMailPrivate.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{EMailPrivate} #IF(#ShopRegistrationField.EMailPrivate.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.EMailPrivate.IsShippingAddressMandatory) ep.uiValidate({required:true,type:'email' #IF(#FormError_ShippingEMailPrivate) ,valid:false #ENDIF }) #ELSE ep.uiValidate({type:'email'}) #ENDIF" name="ShippingEMailPrivate" value="#IF(#ShippingEMailPrivate)#ShippingEMailPrivate#ENDIF" /></div>
          </div>
      #ENDIF
          <div class="InputBlock">
            <br />
          </div>
      #IF(#ShopRegistrationField.Birthday.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{Birthday} #IF(#ShopRegistrationField.Birthday.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.Birthday.IsShippingAddressMandatory) ep.uiValidate({required:true,type:'date',format:'d' #IF(#FormError_ShippingBirthday) ,valid:false #ENDIF }) #ELSE ep.uiValidate({type:'date',format:'d'}) #ENDIF" name="ShippingBirthday" value="#IF(#ShippingBirthday)#ShippingBirthday[date]#ENDIF" /><br />
            <samp>{Example} #Now[date]</samp>
            </div>
          </div>
      #ENDIF
      #IF(#ShopRegistrationField.URL.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{URL} #IF(#ShopRegistrationField.URL.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.URL.IsShippingAddressMandatory) ep.uiValidate({required:true,type:'url' #IF(#FormError_ShippingURL) ,valid:false #ENDIF}) #ELSE ep.uiValidate({type:'url'}) #ENDIF" name="ShippingURL" value="#IF(#ShippingURL)#ShippingURL#ENDIF" /></div>
          </div>
      #ENDIF
      </div>
      <div class="ClearBoth"></div>
    </div>
  #IF(#ShippingAddress.ID)
    <span class="CustomButton">
      <button type="button" name="Cancel" value="{Cancel}" onclick="self.location.href='?ViewObjectID=#ID&amp;ViewAction=ViewAddress&amp;ChangeObjectID=#ShippingAddress.ID&amp;ChangeAction=Delete&amp;ACCEPT=1'">
        <span class="ep-sprite ep-sprite-s Icon DeleteIconSmall"></span>{DeleteShippingAddress}
      </button>
    </span>
  #ENDIF

   #IF(#ShopRegistrationField.BankCode.IsShippingAddressVisible OR
      #ShopRegistrationField.BankName.IsShippingAddressVisible OR
      #ShopRegistrationField.BankAccountNo.IsShippingAddressVisible OR
      #ShopRegistrationField.BankAccountHolder.IsShippingAddressVisible)
    <div class="TableHead"><div>{AccountData}</div></div>
    <div class="Dialog AddressDialog">
      <div class="SizeContainer">
        #IF(#ShopRegistrationField.BankAccountHolder.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{BankAccountHolder} #IF(#ShopRegistrationField.BankAccountHolder.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.BankAccountHolder.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingBankAccountHolder) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingBankAccountHolder" value="#IF(#ShippingBankAccountHolder)#ShippingBankAccountHolder#ENDIF" /></div>
          </div>
        #ENDIF
        #IF(#ShopRegistrationField.BankAccountNo.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{BankAccountNo} #IF(#ShopRegistrationField.BankAccountNo.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.BankAccountNo.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingBankAccountNo) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingBankAccountNo" value="#IF(#ShippingBankAccountNo)#ShippingBankAccountNo#ENDIF" /></div>
          </div>
        #ENDIF
        #IF(#ShopRegistrationField.BankCode.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{BankCode} #IF(#ShopRegistrationField.BankCode.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.BankCode.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingBankCode) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingBankCode" value="#IF(#ShippingBankCode)#ShippingBankCode#ENDIF" /></div>
          </div>
        #ENDIF
        #IF(#ShopRegistrationField.BankName.IsShippingAddressVisible)
          <div class="InputBlock">
            <div class="InputLabelling">{BankName} #IF(#ShopRegistrationField.BankName.IsShippingAddressMandatory){MandatoryStar}#ENDIF</div>
            <div class="InputField"><input class="Text ep-metaparse #IF(#ShopRegistrationField.BankName.IsShippingAddressMandatory) ep.uiValidate({required:true #IF(#FormError_ShippingBankName) ,valid:false #ENDIF }) #ELSE ep.uiInput() #ENDIF" name="ShippingBankName" value="#IF(#ShippingBankName)#ShippingBankName#ENDIF" /></div>
          </div>
        #ENDIF
      </div>
      <div class="ClearBoth"></div>
    </div>
   #ENDIF

  </div>#ENDREM #REM id="ShippingAddress" #ENDREM
#REM
#IF(#Session.User.IsAnonymous)
  <div class="TableHead"><div>{BecomeMemberQuestion}</div></div>
  <div class="AddressDialog Dialog">
    <div class="SizeContainer">
      <div>{ProMemberInfo}:</div>
      <div class="FloatLeft">
        <ul class="BottomSmallMargin">
          <li>{ProMember1}</li>
          <li>{ProMember2}</li>
          <li>{ProMember3}</li>
        </ul>
      </div>
      <table class="FormGrid ClearBoth LeftSmallMargin TopSmallMargin">
        <tr>
          <td class="NoWrap RightPadding AlignTop #IF(#FormError_UserName) DialogError #ENDIF ">{UserName} {MandatoryStar}</td>
          <td class="InputField"><input class="LongText ep-metaparse ep.uiInput()" id="UserNameInput" name="UserName" value="#IF(#UserName)#UserName#ENDIF" /></td>
        </tr>
        <tr>
          <td class="NoWrap RightPadding AlignTop #IF(#FormError_Password AND #INPUT.Origin EQ "BasketAddress") DialogError #ENDIF ">{Password} {MandatoryStar}</td>
          <td class="InputField">
            <input class="Text ep-metaparse ep.uiInput()" type="password" name="Password" id="RegistrationPassword" value="" />
            <i class="Icon HelpIcon" title="{PasswordLength}"></i>
          </td>
        </tr>
        <tr class="#IF(#FormError_Password)DialogError#ENDIF">
          <td class="NoWrap RightPadding AlignTop">{PasswordConf} {MandatoryStar}</td>
          <td class="InputField"><input class="Text ep-metaparse ep.uiInput()" type="password" name="PasswordConf" id="RegistrationPasswordConf" value="" /></td>
        </tr>
      </table>
      #LOCAL("RegistrationSetHasItems",0)
        #LOOP(#Shop.RegistrationSet)
          #IF(#IsVisible AND NOT #IsShippingAddressVisible AND NOT #IsBillingAddressVisible)#SET("RegistrationSetHasItems",1)#ENDIF
        #ENDLOOP
        #IF(#RegistrationSetHasItems)
          <br/>
          <strong class="ShowElement BottomSmallMargin">{FurtherInformation}</strong>
          #LOCAL("ErrorItemNo",0)
            #LOOP(#Shop.RegistrationSet)#BLOCK("WITH_FORM_ERROR", #FormError)#IF(#IsVisible AND NOT #IsShippingAddressVisible AND NOT #IsBillingAddressVisible)
               #INCLUDE("INC-Attributes")
            #ENDIF#ENDBLOCK#ENDLOOP
          #ENDLOCAL
        #ENDIF
      #ENDLOCAL
    </div>
    <div class="ClearBoth"></div>
  </div>
#ENDIF
#ENDIF
#ENDWITH_ERROR
#ENDLOCAL
  #IF(#Shop.AcceptPrivacyPolicy)
    <div class="InputBlock">
      <input type="checkbox" class="ep-metaparse ep.uiValidate({required:true #IF(#FormError_AcceptPrivacyPolicy) ,valid:false #ENDIF })" name="AcceptPrivacyPolicy" id="AcceptPrivacyPolicy" />
      <label for="AcceptPrivacyPolicy">#INCLUDE("INC-PrivacyPolicyNote")</label>
    </div>
    <div class="Separator"></div>
  #ENDIF
    <div class="OrderProcessNavigation">
      <input type="hidden" name="ChangeAction" value="SaveCustomerData" />
      <input type="hidden" name="ChangeAction" value="DoOrder" />
      <input type="hidden" name="ErrorAction" value="ViewAddress" />
      <input type="hidden" name="Origin" value="BasketAddress" />
      #IF(#Session.SessionID)
      <input type="hidden" name="SessionID" value="#Session.SessionID" />
      #ENDIF
      <span class="DoOrder FloatRight">
        <button type="submit" class="ep-metaparse ep.uiInput()" name="Save" value="" onclick="this.form.ChangeAction.value='DoOrder';ep.local.checkRegistrationSubmit();">
          <span class="ep-sprite ep-sprite-s Icon ContinueIconTiny"></span>{Next}
        </button>
      </span>
    </div>
    <div class="Separator"></div>
  </form>
</div>
<script type="text/javascript"> // <![CDATA[
    ep.ready( function($) {
      var checkBox = $("#EnableShippingAddress");
      var shippingAddressBlock = jq("#ShippingAddressBlock");
      checkBox.bind("change changeAttr", function() {
        if(checkBox.is(":checked")) {
          shippingAddressBlock.show().find(":input").attr("disabled", false);
        } else {
          shippingAddressBlock.hide().find(":input").attr("disabled", true);
        }
      });

      ep.local.checkRegistrationSubmit = function(/* Object */ evt) {
        var userNameInput = jq('#UserNameInput');
        var passwd = jq('#RegistrationPassword');
        var passwdConf = jq('#RegistrationPasswordConf');
        if(userNameInput.val() != "" && (passwd.val() != passwdConf.val()) ) {
          // UserName given, passwd and passwdConfirmation doesn't match
          userNameInput.parent().parent().addClass('DialogError');
          passwd.parent().parent().addClass('DialogError');
          passwdConf.parent().parent().addClass('DialogError');
          evt.preventDefault();
        }
      };


      #IF((#FormError AND #INPUT.EnableShippingAddress) OR #ShippingAddress)
      checkBox.attr("checked",true);
      #ELSE
      checkBox.attr("checked",false);
      #ENDIF
    } );
    // ]]>
</script>
 #ENDREM
